<template>
	<view>
		<!-- 充值记录 -->
		<cus-navbar navbar :title="$t('index101')"></cus-navbar>
		<view class="main-padding">
			<view class="gap-30"></view>
			<view class="main-card mb-20 size-28" v-for="(item,index) in list" :key="index">
				<view class="flex justify-between align-center">
					<!-- 充值状态 -->
					<view class="color-71">{{$t('index97')}}</view>
					<!-- 审核中 -->
					<view v-if="item.status==1">{{$t('index61')}}</view>
					<!-- 审核通过 -->
					<view v-if="item.status==2" class="color-green">{{$t('index62')}}</view>
					<!-- 已驳回 -->
					<view v-if="item.status==3" class="color-red">{{$t('index63')}}</view>
				</view>
				<view class="flex justify-between align-center mt-30">
					<!-- 充值金额 -->
					<view class="color-71">{{$t('index98')}}</view>
					<view class="">{{item.price}}</view>
				</view>
				<view class="flex justify-between align-center mt-30">
					<!-- 提交时间 -->
					<view class="color-71">{{$t('index99')}}</view>
					<view class="">{{item.created_at}}</view>
				</view>
				<view class="flex justify-between align-center mt-30" v-if="item.remark">
					<!-- 驳回原因 -->
					<view class="color-71">{{$t('index100')}}</view>
					<view class="color-red">{{item.remark}}</view>
				</view>
			</view>
			<cus-empty v-show="list.length==0"></cus-empty>
			<uni-load-more :status="loadStatus"></uni-load-more>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return{
				list:[],
				page:1,
				limit:10,
				loadStatus:'loading'
			}
		},
		onLoad() {
			this.loadData(true)
		},
		onPullDownRefresh() {
			this.loadData(true, true)
		},
		onReachBottom() {
			if(this.loadStatus=='noMore')return
			this.page++
			this.loadData()
		},
		methods:{
			loadData(flag, refresh){
				if(flag)this.page=1
				this.loadStatus = 'loading'
				this.$api.post('/data/api.auth.invest/rechargeLog',{
					page:this.page,
					limit:this.limit
				}).then(res=>{
					this.list = res.list
					this.loadStatus = res.list.length==this.limit?'more':'noMore'
					if(refresh)uni.stopPullDownRefresh()
				})
			},
		}
	}
</script>

<style lang="scss">

</style>